package com.ylr.dbtest;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ylr
 * @version 1.0.0
 * @ClassName DbController.java
 * @Description TODO
 * @createTime 2022年03月18日 18:02:00
 */
@RestController
public class DbController {
    @Resource
    private StudentMapper studentMapper;

    public DbController() {
    }
    @GetMapping({"addstudent"})
    public int addstudent( int id, String name) {
        return this.studentMapper.insert(new Student(id,name));
    }

    @GetMapping({"student"})
    public List<Student> getUserInfo() {
        return this.studentMapper.selectList((Wrapper)null);
    }
}

